﻿using IapService.Entity;

namespace IapService.Data
{
    public class ClientInstanceData : Data<ClientInstance>
    {
        public new ClientInstance Save(ClientInstance item)
        {
            using (var session = Session)
            {
                item.Instance = new InstanceData().Save(item.Instance);
                session.SaveOrUpdate(item);
                session.Flush();
            }
            return item;
        }

        public new ClientInstance Remove(ClientInstance item)
        {
            using (var session = Session)
            {
                session.Delete(item);
                session.Flush();
            }
            return item;
        }
    }
}